<?php
//namespace escouting\group_calendar;

class Day {
	public function __construct ( DateTime $date = null ) {
		if ( is_null ( $date ) )
			$date = new DateTime ();
		$this->base_date = $date;
	}
	
	public $base_date;  //DateTime object

	public function get_relative_date ( DateInterval $interval ) {
		$date = clone $this->base_date;
		$day = new Day ( $date->add ( $interval ) );
		return $day;
	}
	
	public function format ( $format ) {
		return $this->base_date->format ( $format );
	}
	
	public function get_day_of_week () {
		return $this->format ( "l" );
	}
	
	public function get_day_of_week_number () {
		return $this->format ( "N" );
	}
	
	public function get_day_of_month () {
		return $this->format ( "j" );
	}
}